﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BuscarVideos.aspx.cs" Inherits="BuscarVideos" Title="Untitled Page" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="demoheading" style="width:400px">Buscar Vídeo</div>
    <div class="collapsePanelHeader" style="width: 400px; height: 15px">Buscar Vídeos</div>
     <table style="width: 40%" class="divDados">
        <tr>
            <td style="width: 839px">
                <asp:Label ID="lbNome" runat="server" Text="Nome"></asp:Label>
            </td>
            <td style="width: 720px">
                <asp:TextBox ID="tbNome" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 839px">
                <asp:Label ID="lbGenero" runat="server" Text="Gênero"></asp:Label>
            </td>
            <td style="width: 720px">
                <asp:DropDownList ID="ddlGenero" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="odsGenero" DataTextField="Nome" DataValueField="Codigo">
                    <asp:ListItem Value="0">Selecione Genero</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsGenero" runat="server" 
                    DataObjectTypeName="Negocios.Genero" DeleteMethod="Remover" 
                    InsertMethod="Inserir" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ConsultarTodos" TypeName="Negocios.GeneroBLL" 
                    UpdateMethod="Atualizar"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 839px">
                <asp:Label ID="lbAutor" runat="server" Text="Autor"></asp:Label>
            </td>
            <td style="width: 720px">
                <asp:DropDownList ID="ddlAutor" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="odsAutor" DataTextField="Nome" DataValueField="Codigo">
                    <asp:ListItem Value="0">Selecione Autor</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsAutor" runat="server" 
                    DataObjectTypeName="Negocios.Autor" DeleteMethod="Remove" InsertMethod="Insere" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                    TypeName="Negocios.AutorBLL" UpdateMethod="Atualiza"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 839px; height: 58px;">
                <asp:Label ID="lbFormato" runat="server" Text="Formato"></asp:Label>
            </td>
            <td style="width: 720px; height: 58px;">
                <asp:DropDownList ID="ddlFormato" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="odsFormato" DataTextField="Nome" DataValueField="Codigo">
                    <asp:ListItem Value="0">Selecione Formato</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsFormato" runat="server" 
                    DataObjectTypeName="Negocios.Formato" DeleteMethod="Remove" 
                    InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ConsultaTodos" TypeName="Negocios.FormatoBLL" 
                    UpdateMethod="Atualiza"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 839px">
                <asp:Label ID="lbEspecificacao" runat="server" Text="Especificação"></asp:Label>
            </td>
            <td style="width: 720px">
                <asp:DropDownList ID="ddlEspecificacao" runat="server" 
                    DataSourceID="odsEspecificacao" DataTextField="Nome" DataValueField="Id" 
                    AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Selecione Especificação</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsEspecificacao" runat="server" 
                    DataObjectTypeName="Negocios.Especificacao" InsertMethod="Insere" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodosVisao" 
                    TypeName="Negocios.EspecificacaoBLL"></asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:Button ID="btPesquisar" runat="server" Text="Pesquisar" 
                    onclick="btPesquisar_Click" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btCancelar" runat="server" onclick="btCancelar_Click" 
                    Text="Cancelar" />
            </td>
        </tr>
    </table>
    <br />
    <br />
    <div class="collapsePanelHeader" style="width: 400px; height: 15px"></div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="odsTabela">
        <Columns>
            <asp:BoundField DataField="Codigo" HeaderText="Codigo" 
                SortExpression="Codigo" />
            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
            <asp:BoundField DataField="Localizacao" HeaderText="Localizacao" 
                SortExpression="Localizacao" />
            <asp:BoundField DataField="Genero" HeaderText="Genero" 
                SortExpression="Genero" />
            <asp:BoundField DataField="Autor" HeaderText="Autor" SortExpression="Autor" />
            <asp:BoundField DataField="Formato" HeaderText="Formato" 
                SortExpression="Formato" />
            <asp:BoundField DataField="Especificacao" HeaderText="Especificacao" 
                SortExpression="Especificacao" />
            <asp:BoundField DataField="Software" HeaderText="Software" 
                SortExpression="Software" />
            <asp:BoundField DataField="Usuario" HeaderText="Usuario" 
                SortExpression="Usuario" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="odsTabela" runat="server" 
        DataObjectTypeName="Negocios.Video" InsertMethod="Insere" 
        OldValuesParameterFormatString="original_{0}" onselecting="odsTabela_Selecting" 
        SelectMethod="ConsultarParametros" TypeName="Negocios.VideoBLL">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbNome" Name="nome" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="ddlGenero" DefaultValue="0" Name="genero" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ddlAutor" DefaultValue="0" Name="autor" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ddlFormato" DefaultValue="0" Name="formato" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ddlEspecificacao" DefaultValue="0" 
                Name="especificacao" PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

